class ConstantType:
    # K线周期
    FREQUENCY = "FREQUENCY"

    # 市场类型
    MARKET = "MARKET"

    # 使用状态
    STATE = "STATE"

    # 复权
    ADJUST = "ADJUST"


class ConstantJQDataFrequency:
    # K线周期:tick
    FREQUENCY_TICK = "tick"
    
    # K线周期:1分钟
    FREQUENCY_1MIN = "1m"
    
    # K线周期:5分钟
    FREQUENCY_5MIN = "5m"
    
    # K线周期:15分钟
    FREQUENCY_15MIN = "15m"
    
    # K线周期:30分钟
    FREQUENCY_30MIN = "30m"
    
    # K线周期:60分钟
    FREQUENCY_60MIN = "60m"
    
    # K线周期:120分钟
    FREQUENCY_120MIN = "120m"
    
    # K线周期:1天
    FREQUENCY_1D = "1d"
    
    # K线周期:1周
    FREQUENCY_1W = "1w"
    
    # K线周期:1月
    FREQUENCY_1M = "1M"
    
    # K线周期:1年
    FREQUENCY_1Y = "1y"
    
    # K线周期:1分钟
    FREQUENCY_1MIN = "1m"
    
    # K线周期:5分钟
    FREQUENCY_5MIN = "5m"
    
    # K线周期:15分钟
    FREQUENCY_15MIN = "15m"
    
    # K线周期:30分钟
    FREQUENCY_30MIN = "30m"
    
    # K线周期:60分钟
    FREQUENCY_60MIN = "60m"
    
    # K线周期:120分钟
    FREQUENCY_120MIN = "120m"
    
    # K线周期:1天
    FREQUENCY_1D = "1d"
    
    # K线周期:1周
    FREQUENCY_1W = "1w"
    
    # K线周期:1月
    FREQUENCY_1M = "1M"
    
    # K线周期:1年
    FREQUENCY_1Y = "1y"
    

class ConstantItem:
    # K线周期:1s tick=3s
    FREQUENCY_1S = "1s"
    
    # K线周期:1分钟
    FREQUENCY_1MIN = "1min"

    # K线周期:5分钟
    FREQUENCY_3MIN = "3min"
    
    # K线周期:5分钟
    FREQUENCY_5MIN = "5min"
    
    # K线周期:15分钟
    FREQUENCY_15MIN = "15min"
    
    # K线周期:30分钟
    FREQUENCY_30MIN = "30min"
    
    # K线周期:1小时
    FREQUENCY_1HOUR = "1hour"
    
    # K线周期:2小时
    FREQUENCY_2HOUR = "2hour"
    
    # K线周期:4小时
    FREQUENCY_4HOUR = "4hour"
    
    # K线周期:6小时
    FREQUENCY_6HOUR = "6hour"
    
    # K线周期:8小时
    FREQUENCY_8HOUR = "8hour"
    
    # K线周期:12小时
    FREQUENCY_12HOUR = "12hour"
    
    # K线周期:1天
    FREQUENCY_1D = "1D"
    
    # K线周期:1周
    FREQUENCY_1W = "1W"
    
    # K线周期:1月
    FREQUENCY_1M = "1M"
    
    # 市场类型:期货
    MARKET_FUTURES = "1"
    
    # 市场类型:股票
    MARKET_STOCKS = "2"
    
    # 市场类型:指数
    MARKET_INDICES = "3"
    
    # 市场类型:债券
    MARKET_BONDS = "4"
    
    # 市场类型:外汇
    MARKET_FOREX = "5"
    
    # 市场类型:加密货币
    MARKET_CRYPTOCURRENCY = "6"
    
    # 市场类型:世界财经数据
    MARKET_WORLD_ECONOMIC_DATA = "7"
    
    # 市场类型:ETF
    MARKET_ETF = "8"
    
    # 使用状态:禁用
    STATE_ENABLED = "1"
    
    # 使用状态:禁用
    STATE_DISABLED = "0"
    
    # 复权类型: 后复权
    ADJUST_BACK = "1"
    
    # 复权类型: 前复权
    ADJUST_FORE = "2"
    
    # 复权类型: 不复权
    ADJUST_NO = "3"

class RedisConstant:
     SPIDER_LAST_BARS = 'spider:{symbol}:{frequency}'

class ExchangeType:
    BINANCE = 1
    OKEX = 2
    HUOBI = 3
    CHINA_STOCK = 4
    CHINA_FUTURE = 5
    
    
class MarketType:
    STOCK = 1               # 股票
    INDEX = 2               # 指数
    ETF = 3                 # ETF基金
    FJA = 4                 # 分级A
    FJB = 5                 # 分级B
    FJM = 6                 # 分级母基金
    MMF = 7                 # 场内交易的货币基金
    OPEN_FUND = 8           # 开放式基金
    BOND_FUND = 9           # 债券基金
    STOCK_FUND = 10         # 股票型基金
    QDII_FUND = 11          # QDII 基金
    MONEY_MARKET_FUND = 12  # 场外交易的货币基金
    MIXTURE_FUND = 13       # 混合型基金
    OPTIONS = 14            # 期权
    pass